var app = getApp();
Page({
    data:{
        "text":"",
        "max":12,
        "curnum":0
    },
    onLoad:function(e){
        console.log(e);
    },
    changetextarea:function(e){
        this.setData({
            'text':e.detail.value
        });
        var curtext=this.data.text;
        var textLen=curtext.length;
        var textmax=this.data.max;

        if(textLen<textmax){
            this.setData({
                'curnum':textLen
            });
        }else{
            this.setData({
                'text':curtext.slice(0,textmax),
                "curnum":textmax
            });
        };
        sessionStorage.setItem("textarea",this.data.text);
    },
    formSubmit: function(e) {
        console.log("提交");
        console.log(e);
    },
})